Skip to content

fix(reports): a report's PDF reaches DOCiD once its embargo ends - #1694

Merged
sickerine merged 1 commit into
devfrom
fix/docid-embargo-file
Dec 1, 2026
Merged

sickerine merged 1 commit into
devfrom
fix/docid-embargo-file

Conversation

@sickerine

Copy link
Copy Markdown
Collaborator

A report published with an embargo never got its PDF on DOCiD. The deposit sends the file only when anyone may get it, which is right, since DOCiD shows everything it holds. But when the embargo ended, openEmbargoes registered the report again and the registrar only called DOCiD's update, which sends title, description and DOI. The file never arrived.

What changes:

  • When a report DOCiD already holds is open (its embargo ended, or a reviewer opened a private file) and DOCiD doesn't have its PDF yet, the registrar adds the PDF to the record with doi-sync-core's new addFile (feat(docid): add a file to a deposited record, once doi-sync-core#25, pinned at its merge commit). DOCiD gives the file a Handle of its own.
  • addFile reads the record's files first, so a try whose answer was lost, or a file the deposit already carried, is found and never sent again. The file's Handle is kept on the report as registrations.docid.fileHandle, so later registrations don't ask at all. A deposit that carries the file records the record's own Handle there.
  • DOCiD takes no added file over 25 MB. Such a PDF is left out: the DOCiD registration is done, and its error says the record has no PDF and why, where reviewers see the other registrar messages. The log gets report-docid-file-too-large.
  • Logs: report-docid-file-add before the call, report-docid-file-added with DOCiD's answer (held or added), the file's id and its Handle.

Crossref and Zenodo already handle the embargo and are unchanged.

Data: registrations.docid.fileHandle is a new optional field, so no migration is needed. Reports DOCiD holds with a file from before this change get the lookup once on their next registration and keep the Handle they find.

Checks: npx tsc --noEmit, npm run check:convex-rules, and vitest on convex/reports/{registration,identifiers,paper,activation}.test.ts (80 passed). The new registrar test runs the real action against a stubbed DOCiD. It covers an embargo ending, a re-registration that sends nothing, a lost answer that finds the file, and a PDF over 25 MB. It fails with the add-file step switched off. The cross-family review (GPT-6.1 Sol) found two issues, both fixed in doi-sync-core#25: matching DOCiD's stored file name, and looking for a held file before the size limit.

A deposit carries the PDF only when anyone may get it, and DOCiD's update route can't add a file. When a report DOCiD already holds opens (an embargo ending, or a reviewer opening a private file), the registrar now adds its PDF to the record through doi-sync-core's addFile, which looks for it on the record first so a retry never mints a second Handle. The file's Handle is kept on the report's DOCiD registration (fileHandle), so it is never sent again. A PDF over DOCiD's 25 MB limit is left out: the registration is done and its error says why. Every add is logged with DOCiD's answer and the Handle.
@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 17e0bab4-862e-4534-b24d-4e8750fc68b4
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T20:59:19.232254Z e57acf3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sickerine
sickerine merged commit 7d65ae6 into dev Dec 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant